﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsForms
{
    public partial class TimerDemo : Form
    {
        public TimerDemo()
        {
            InitializeComponent();
        }
        //设置开始时间
        public bool timeStart;
        private void TimerDemo_Load(object sender, EventArgs e)
        {
            timeStart = false;
            timeTomato.Enabled = true;
            timeNow.Enabled = true;
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            timeStart = false;
        }

        private void timeTomato_Tick(object sender, EventArgs e)
        {
            timeTomato.Enabled = false;
            if(timeStart==false)
            {
                MessageBox.Show("可以开始番茄时间了吗？", "提示信息", MessageBoxButtons.OK);
                timeStart = true;
            }
            timeTomato.Enabled = true;
        }

        private void timeRest_Tick(object sender, EventArgs e)
        {
            lblTime.Text = "当前时间：" + System.DateTime.Now;
        }
    }
}
